package com.xiaohu.myspace.database.daoimple;

import java.util.List;

import org.hibernate.Session;

import com.xiaohu.myspace.database.MyHibernateDaoSupport;
import com.xiaohu.myspace.database.dao.OptionInfoDao;
import com.xiaohu.myspace.database.entity.OptionInfo;

public class OptionInfoDaoImple extends MyHibernateDaoSupport<OptionInfo> implements OptionInfoDao {

	@Override
	public boolean addOptionInfo(OptionInfo optionInfo, Session session) {
		return insertEntity(optionInfo, session);
	}

	@Override
	public boolean deleteOptionInfo(OptionInfo optionInfo, Session session) {
		return deleteEntity(optionInfo, session);
	}

	@Override
	public boolean updateOptionInfo(OptionInfo optionInfo, Session session) {
		return updateEntity(optionInfo, session);
	}

	@Override
	public List<OptionInfo> selectOptionInfoWithOptionCode(int optionCode,
			Session session) {
		String hql="from OptionInfo where optionCode="+optionCode;
		return getAllObjectWithHql(hql, session);
	}


}
